package com.hhkj.study.admin.config.controller;

import com.hhkj.study.admin.config.entity.ConfigBase;
import com.hhkj.study.admin.config.model.req.ConfigBaseReq;
import com.hhkj.study.admin.config.model.res.ConfigBaseRes;
import com.hhkj.study.admin.config.service.biz.ConfigBaseBizService;
import com.ruoyi.common.annotation.PermissionPrefix;
import com.ruoyi.common.base.biz.controller.v3.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.valid.VDisable;
import com.ruoyi.common.valid.VEdit;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
* ConfigBaseController
*
* @author SERVER
* @since 2024-09-06
*/
@RestController
@PermissionPrefix("config:configBase")
@Controller
@RequestMapping("/admin/config/base")
public class ConfigBaseController extends BaseController<ConfigBase, ConfigBaseReq, ConfigBaseRes, ConfigBaseBizService> {

    /** 禁用/启用 */
    @PreAuthorize("@ss.hasPermi(this, 'edit')")
    @PutMapping("/disable/flag")
    public AjaxResult updateDisableFlag(@Validated(value = {VDisable.class , VEdit.class}) @RequestBody ConfigBaseReq req) {
        return toAjax(this.getBizService().updateDisableFlag(req));
    }
}
